<?php include "../public/header.php";?>
<?php include "../public/header_show.php";?>
<body id="xiangqingPage">
<div id="xiangqingBox">
    <div class="page-title">
        <div class="page-title-con">
            <span class="pageshowtitle">打印</span>
            <div class="page-title-opt-list">
                <button type="button" class="layui-btn layui-btn-sm btn-dark marginr5" onclick="print_area()">打印</button>
                <span id="page-close" class="page-close" onclick="layer_close()">×</span>
            </div>
        </div>
    </div>
    <div id="printuplist">
        <div class="tablenes">
            <style>
                .tablenes{margin-top: 50px}
                .ptit{font-size: 16px;text-align: center!important;}
                .pname{font-size: 24px;text-align: center!important;font-weight: bold}
                .za{font-size: 12px!important;}
                .za .rr{float: right;margin-bottom: 5px;}
                .diza .rr{float: right;margin-top: 20px;margin-right: 150px}
            </style>
        </div>


        <div id="listinfo">

        </div>

    </div>

</div>
<script>
    var param_numbers = getQueryVariable('numbers') || '';

    layui.use(['form', 'layer', "laytp",'element','dropdown','laypage','table','soulTable'], function() {
        var laypage = layui.laypage, table = layui.table, dropdown = layui.dropdown, form = layui.form, soulTable = layui.soulTable,element = layui.element;

        facade.ajax({url: ask_printup_stuff_dantui, data:{numbers: param_numbers}}).done(function(res){
            if (res.code === 2000) {
                var data = res.data;
                var str = '';
                var list = data.data;


                for (var mmm in list) {
                    str += '<div class="main-container">';
                    str += '<div class="table-box tablenes">';
                    str += '<div class="ptit">'+data.chanid_name+'</div>';
                    str += '<div class="pname">材料退库单</div>';

                    str += '<div class="za">';
                    str += '<span class="rr">退库单号：<span>'+list[mmm].number+'</span></span>';
                    str += '</div>';
                    str += '<div style="clear: both"></div>';

                    str += '<div class="za">';
                    str += '<span class="ll">项目名称：<span>'+list[mmm].enginid_name+'</span></span>';
                    str += '<span class="rr">退库日期：<span>'+list[mmm].tuidt+'</span></span>';
                    str += '</div>';
                    str += '<div style="clear: both"></div>';

                    str += '<table class="layui-table">';
                    str += '<tbody>';
                    str += '<tr>';
                    str += '<td><b>序号</b></td><td><b>物资名称及规格</b></td><td><b>单位</b></td><td><b>供应商</b></td><td><b>本次退库数量</b></td><td><b>备注</b></td>';
                    str += '</tr>';

                    var mingxi = list[mmm].mingxi;
                    for (var nnn in mingxi) {
                        var xuhao = parseInt(nnn)+1;

                        str += '<tr>';
                        str += '<td>'+xuhao+'</td>';
                        str += '<td>'+mingxi[nnn].name+'</td>';
                        str += '<td>'+mingxi[nnn].unit+'</td>';
                        str += '<td>'+mingxi[nnn].gonger+'</td>';
                        str += '<td>'+mingxi[nnn].num+'</td>';
                        str += '<td>'+mingxi[nnn].explain+'</td>';
                        str += '</tr>';
                    }


                    str += '</tbody>';
                    str += '</table>';

                    str += '<div class="diza">';
                    str += '<span class="rr">打印人：'+data.userid_name+'</span>';
                    str += '<span class="rr">退料人：'+list[mmm].baner+'</span>';
                    str += '</div>';
                    str += '<div style="clear: both"></div>';
                    str += '</div>';
                    str += '</div>';
                }

                $("#listinfo").html(str);
            }
        });


    });



</script>
</body>
</html>




